﻿namespace Sidvall.Security
{
    public class UserItem
    {
        #region Public Members

        #region Name

        private string _Name;
        public string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                value = Sidvall.Business.ValidationManager.GetValidString(value, false, null);
                _Name = value;
            }
        }

        #endregion
        #region UserStatus

        private IdentityStatus _UserStatus;
        public IdentityStatus UserStatus
        {
            get
            {
                return _UserStatus;
            }
            set
            {
                _UserStatus = value;
            }
        }

        #endregion
        #region UserStatusReasonPhrase

        private string _UserStatusReasonPhrase;
        public string UserStatusReasonPhrase
        {
            get
            {
                return _UserStatusReasonPhrase;
            }
            set
            {
                _UserStatusReasonPhrase = value;
            }
        }

        #endregion
        #region Context

        private string _Context = string.Empty;
        public string Context
        {
            get
            {
                return _Context;
            }
            set
            {
                value = Sidvall.Business.ValidationManager.GetValidString(value, false, null);
                _Context = value;
            }
        }

        #endregion
        #region CreatedTime

        private System.DateTime _CreatedTime;
        public System.DateTime CreatedTime
        {
            get
            {
                return _CreatedTime;
            }
            set
            {
                value = Sidvall.Business.ValidationManager.GetValidUniversalDateTime(value, System.DateTimeKind.Utc);
                _CreatedTime = value;
            }
        }

        #endregion
        #region UpdatedTime

        private System.DateTime _UpdatedTime;
        public System.DateTime UpdatedTime
        {
            get
            {
                return _UpdatedTime;
            }
            set
            {
                value = Sidvall.Business.ValidationManager.GetValidUniversalDateTime(value, System.DateTimeKind.Utc);
                _UpdatedTime = value;
            }
        }

        #endregion
        #region Claims

        private Sidvall.Security.ClaimCollection _Claims;
        public Sidvall.Security.ClaimCollection Claims
        {
            get
            {
                if (_Claims == null)
                    _Claims = new Sidvall.Security.ClaimCollection();
                return _Claims;
            }
        }

        #endregion

        #endregion
        #region Constructors

        public UserItem()
        {
        }

        #endregion
    }
}
